package com.inspur.gs.sbssdl.sbwhgl.sbwhby.sbwhby.front.newsbbyjh_frm.voactions;
import com.inspur.edp.bff.api.manager.context.QueryContext;
import com.inspur.edp.bff.spi.action.query.BeforeQueryAction;
import com.inspur.edp.cef.entity.condition.EntityFilter;
import com.inspur.edp.cef.entity.condition.FilterCondition;

import java.util.ArrayList;

public class queryBeforeVOAction extends BeforeQueryAction {

	public queryBeforeVOAction(QueryContext context){
		super(context);
	}
	@Override
	public void execute() {
		String lbbh = (String) this.getContext().getVariableData().getValue("lbbh");

		if (lbbh != null && !lbbh.isEmpty()) {
			//定义filter
			EntityFilter filter = getQueryContext().getFilter();

			ArrayList<FilterCondition> filterList = new ArrayList<>(FilterCondition.builder()
					.orLikeStartWith("lbbh", lbbh)
					.build());
			filter.addFilterConditions(filterList);
		}
	}
}
